;;; init.el --- My init script -*- coding: utf-8 ; lexical-binding: t -*-
;; Author: rxf4e1
;; URL:
;; Version: 1.00

;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; In noninteractive sessions, prioritize non-byte-compiled source files to
;; prevent the use of stale byte-code. Otherwise, it saves us a little IO time
;; to skip the mtime checks on every *.elc file.
(setq load-prefer-newer noninteractive)

(defvar --backup-directory (concat user-emacs-directory ".backup"))
(if (not (file-exists-p --backup-directory))
    (make-directory --backup-directory t))

(setq backup-directory-alist    `(("." . ,--backup-directory))) ; set backup directory
(setq make-backup-files         t                               ; backup of a file the first time it is saved
      backup-by-copying         t                               ; don't clobber symlinks
      version-control           t                               ; version numbers for backup files
      delete-old-versions       t                               ; delete excess backup files silently
      delete-by-moving-to-trash t
      kept-old-versions         3                               ; oldest versions to keep when a new numbered backup is made (default: 2)
      kept-new-versions         5                               ; newest versions to keep when a new numbered backup is made (default: 2)
      auto-save-default         t                               ; auto-save every buffer that visits a file
      auto-save-timeout         25                              ; number of seconds idle time before auto-save (default: 30)
      auto-save-interval        250                             ; number of keystrokes between auto-saves (default: 300)
 )

;; Custom file
(custom-set-variables '(custom-file (expand-file-name ".custom.el" user-emacs-directory)))

(put 'dired-find-alternate-file 'disabled nil)
(put 'upcase-region 'disabled nil)

;; Add elisp/ to load-path
(add-to-list 'load-path (expand-file-name "elisp/" user-emacs-directory))
;; (add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")

;;;; init config file
(org-babel-load-file (expand-file-name "~/.emacs.d/config.org"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; init.el ends here.
